<!-- 首页 -->
<template>
	<view class="page-index-index">
		<cu-custom  bgColor="bgcolor-main"  :isCustom="true"  >
			<view slot="content" >首页</view>
		</cu-custom>
		<navigator url="/pages/demo/form" class="btn-main inline">表单验证</navigator>
		<navigator url="/pages/demo/qrcode" class="btn-main inline">二维码海报</navigator>
		<navigator url="/pages/demo/article" class="btn-main inline">富文本渲染</navigator>
		<navigator url="/pages/demo/request" class="btn-main inline">网络请求 / 上传</navigator>
		<navigator url="/pages/demo/page" class="btn-main inline">分页查询</navigator>
		<view @click="develop" url="/pages/demo/tabbar" class="btn-main inline">加密解密</view>
		<button  @getuserinfo="getUserInfo" open-type="getUserInfo" class="not-button btn-main inline">用户信息授权</button>
	</view>
</template>

<script>
export default {
	data() {
		return { 
			options:{}
		}
	}, 
	onLoad(options) {
		this.options=options;
	},
	onShareAppMessage(res){
		return {
			title: '',
			path:"/pages/index/index"
		}
	},
	onShow(){},
	onReachBottom(){},
	onHide(){}, 
	onReady(){},
	methods: {
		getUserInfo:function(e){
			//避免后端可能使用session_key解密数据失败的情况，建议获取明文信息用接口直接保存。
			console.log("用户信息",e.detail.userInfo);
			this.globalData.userInfo=e.detail.userInfo;
			console.log(e.detail.userInfo.avatarUrl)
		},
		develop:function(){
			this.$toast("完善中");
		}
	}
}
</script>

<style lang="scss">
	.page-index-index{ 
		text-align: left;
		.btn-main{
			width:40vw ;
			margin:30upx 5vw;
		}
	}
</style>
